<?php

/**
 * Article actions.
 *
 * @package    5
 * @subpackage Article
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ArticleActions extends sfActions
{
  public function executeCategoryIndex(sfWebRequest $request)
  {
    $this->articles = Doctrine_Core::getTable('Article')->findByCategoryId($request->getParameter('id'));
  }

  public function executeShow(sfWebRequest $request)
  {
    $articleTable = Doctrine_Core::getTable('Article');
    $this->article = $articleTable->find(array($request->getParameter('id')));
    $this->forward404Unless($this->article);
    
    $this->articles1 = $articleTable->findByCategoryName('官方动态');
  }
}
